import fetch from '@/utils/request'

export function page(query) {
  return fetch({
    url: '/api/adminCrm/platformBase/pageList',
    method: 'post',
    data: query
  })
}

export function addObj(obj) {
  return fetch({
    url: '/api/admin/crm/platformBase',
    method: 'post',
    data: obj
  })
}
export function addPlatformExtend(obj) {
  return fetch({
    url: '/api/adminCrm/platformBaseExtend/add',
    method: 'post',
    data: obj
  })
}
export function upload(obj) {
  return fetch({
    url: '/api/adminCrm/platformBaseExtend/upload',
    method: 'post',
    data: obj
  })
}
export function updatePlatformExtend(obj) {
  return fetch({
    url: '/api/adminCrm/platformBaseExtend/update',
    method: 'post',
    data: obj
  })
}
export function getPlatformExtend(platformId) {
  return fetch({
    url: '/api/adminCrm/platformBaseExtend/queryInfo/' + platformId,
    method: 'get'
  })
}
export function getObj(id) {
  return fetch({
    url: '/api/adminCrm/platformBase/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return fetch({
    url: '/api/adminCrm/platformBase/deleteOne/' + id,
    method: 'get'
  })
}

export function putObj(id, obj) {
  return fetch({
    url: '/api/admin/crm/platformBase/' + id,
    method: 'put',
    data: obj
  })
}

export function addPlatObj(obj) {
  return fetch({
    url: '/api/adminCrm/platformBase/add',
    method: 'post',
    data: obj
  })
}

export function putPlatObj(obj) {
  return fetch({
    url: '/api/adminCrm/platformBase/update',
    method: 'post',
    data: obj
  })
}

export function getTest() {
  return fetch({
    url: '/api/admin/ad/list',
    method: 'get'
  })
}

export function addChannelConfig(obj) {
  return fetch({
    url: '/api/adminCrm/payChannelConfig/add',
    method: 'post',
    data: obj
  })
}

export function pageSafetyConfig(query) {
  return fetch({
    url: '/api/adminCrm/platformSafetyConfig/pageList',
    method: 'post',
    data: query
  })
}

export function addSafetyConfig(query) {
  return fetch({
    url: '/api/adminCrm/platformSafetyConfig/add',
    method: 'post',
    data: query
  })
}

export function updateSafetyConfig(query) {
  return fetch({
    url: '/api/adminCrm/platformSafetyConfig/update',
    method: 'post',
    data: query
  })
}

export function deleteSafetyConfig(query) {
  return fetch({
    url: '/api/adminCrm/platformSafetyConfig/delete',
    method: 'post',
    data: query
  })
}

export function pageCallBackUrl(query) {
  return fetch({
    url: '/api/adminCrm/platformCallbackUrl/pageList',
    method: 'post',
    data: query
  })
}

export function addCallBackUrl(query) {
  return fetch({
    url: '/api/adminCrm/platformCallbackUrl/add',
    method: 'post',
    data: query
  })
}

export function updateCallBackUrl(query) {
  return fetch({
    url: '/api/adminCrm/platformCallbackUrl/update',
    method: 'post',
    data: query
  })
}

export function deleteCallBackUrl(query) {
  return fetch({
    url: '/api/adminCrm/platformCallbackUrl/delete',
    method: 'post',
    data: query
  })
}

export function pagePayChannelConfig(query) {
  return fetch({
    url: '/api/adminCrm/payChannelConfig/queryList',
    method: 'post',
    data: query
  })
}

export function addPayChannelConfig(query) {
  return fetch({
    url: '/api/adminCrm/payChannelConfig/add',
    method: 'post',
    data: query
  })
}

export function updatePayChannelConfig(query) {
  return fetch({
    url: '/api/adminCrm/payChannelConfig/update',
    method: 'post',
    data: query
  })
}

export function getPlatformObj(platformId) {
  return fetch({
    url: '/api/adminCrm/platformBase/queryOne/' + platformId,
    method: 'get'
  })
}

export function getPlatformAccs(obj) {
  return fetch({
    url: '/api/adminCrm/platformAccoutConfig/pageList',
    method: 'post',
    data: obj
  })
}

export function addPlatformAcc(obj) {
  return fetch({
    url: '/api/adminCrm/platformAccoutConfig/addObj',
    method: 'post',
    data: obj
  })
}

export function getAccountTypes(obj) {
  return fetch({
    url: '/api/admin/dict/selectByType',
    method: 'post',
    data: obj
  })
}

export function getPlatformAccounts(obj) {
  return fetch({
    url: '/api/adminCrm/merchantAccount/pageList',
    method: 'post',
    data: obj
  })
}
